package com.jk.smartelderlycare.controller;

import com.jk.smartelderlycare.dto.SysCoupon;
import com.jk.smartelderlycare.dto.SysHomestay;
import com.jk.smartelderlycare.interfaces.SysCouponServiceApi;
import com.jk.smartelderlycare.pojo.PagedResponse;
import com.jk.smartelderlycare.service.SysCouponService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author hhk
 * @version 1.0
 * @ClassName SysCouponController
 * @program: smart-elderly-care
 * @description: TODO
 * @date 2024/11/28 20:46
 */
@Service
@RestController
public class SysCouponController implements SysCouponServiceApi {
    @Autowired
    private SysCouponService sysCouponService;
    /** 
     * @description: 优惠劵后端分页查询
     * @param: [sysCoupon, pageNum, pageSize]
     * @return: com.jk.smartelderlycare.pojo.PagedResponse<com.jk.smartelderlycare.dto.SysCoupon>
     * @author hhk
     * @date: 2024/11/28 20:46
     */ 
    @Override
    public PagedResponse<SysCoupon> findSysCouponPaginationList(SysCoupon sysCoupon, Integer pageNum, Integer pageSize) {
        return sysCouponService.findSysCouponPaginationList(sysCoupon,pageNum,pageSize);
    }
    /** 
     * @description: 新增优惠劵
     * @param: [sysCoupon]
     * @return: void
     * @author hhk
     * @date: 2024/11/28 20:47
     */ 
    @Override
    public void addSysCoupon(SysCoupon sysCoupon) {
        sysCouponService.addSysCoupon(sysCoupon);
    }
    /** 
     * @description: 根据id删除一条数据
     * @param: [couponId]
     * @return: void
     * @author hhk
     * @date: 2024/11/28 20:47
     */ 
    @Override
    public void deleteSysCouponById(Long couponId) {
        sysCouponService.deleteSysCouponById(couponId);
    }
    /** 
     * @description: 根据id回显一条数据
     * @param: [couponId]
     * @return: com.jk.smartelderlycare.dto.SysCoupon
     * @author hhk
     * @date: 2024/11/28 20:47
     */ 
    @Override
    public SysCoupon findSysCouponById(Long couponId) {
        return sysCouponService.findSysCouponById(couponId);
    }
    /** 
     * @description: 修改优惠劵
     * @param: [sysCoupon]
     * @return: void
     * @author hhk
     * @date: 2024/11/28 20:48
     */ 
    @Override
    public void updataSysCoupon(SysCoupon sysCoupon) {
        sysCouponService.updataSysCoupon(sysCoupon);
    }
    /**
     * @description: 民宿信息
     * @param: []
     * @return: java.util.List<com.jk.smartelderlycare.dto.SysHomestay>
     * @author hhk
     * @date: 2024/11/29 16:30
     */
    @Override
    public List<SysHomestay> findHomestayList() {
        return sysCouponService.findHomestayList();
    }


}
